package LockSupport与线程中断.interrupt;

/**
 * @program: algorithm
 * @description: 通过volatile停止一个中断的线程
 * @author: 陈恩涛
 * @create: 2022-08-12 07:26
 **/
public class InterruptDemo4 {
    static volatile boolean isStop = false;

    public static void main(String[] args) {

        System.out.println(Thread.currentThread().getName() + "\t" + Thread.interrupted());
        System.out.println(Thread.currentThread().getName() + "\t" + Thread.interrupted());

        System.out.println("---------1");
        Thread.currentThread().interrupt();
        System.out.println("---------2");

        System.out.println(Thread.currentThread().getName() + "\t" + Thread.interrupted());
        System.out.println(Thread.currentThread().getName() + "\t" + Thread.interrupted());
    }
}
